using System;
using System.Collections;
using System.Collections.Generic;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;


namespace Server.Items
{
	public class StaffBidLedger : Item
	{
		public static int MaxRecords = 200;

		[Constructable]
		public StaffBidLedger() : base( 0x2259 )
		{
			Name = "a staff bid ledger";
			Hue = 1165;
			Weight = 1.0;
		}

		public StaffBidLedger( Serial serial ) : base( serial )
		{
		}


		public override void OnDoubleClick( Mobile from )
		{
			if ( from.AccessLevel >= AccessLevel.GameMaster )
			{
				List<StaffBid> list = SaveStone.ReloadVendorBids();

				if ( list.Count <= 0 )
					from.SendMessage( "It is empty!" );
				else if ( list.Count > MaxRecords )
					from.SendMessage( "Too many records to be displayed, {0}.", list.Count );
				else
				{
					from.CloseGump( typeof( StaffBidGump ) );
					from.SendGump( new StaffBidGump( from, 0, list ) );
				}
			}

			base.OnDoubleClick( from );
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int)0 ); //version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
	}
}
